package com.wufun.overseas.utils;

import android.util.Log;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * Created by lala on 15/3/19.
 */
public class CompressThreadPoolExecutor extends ThreadPoolExecutor {

    String TAG = getClass().getSimpleName();

    public CompressThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue) {
        super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue);
    }

    @Override
    public void execute(Runnable command) {
        Log.d(TAG,"execute....getPoolSize()="+getPoolSize()+";"+"getActiveCount()="+getActiveCount()+";getTaskCount()="+getTaskCount()+"getCorePoolSize()="+getCorePoolSize()+";queue="+getQueue().size());

        super.execute(command);
    }

    @Override
    public <T> Future<T> submit(Callable<T> task) {
        Log.d(TAG,"submit....");
        return super.submit(task);
    }

    @Override
    public <T> Future<T> submit(Runnable task, T result) {
        Log.d(TAG,"submit....222");
        return super.submit(task, result);
    }
}
